<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        <title>20jQuery操作CSS样式</title>
        <script src="http://code.jquery.com/jquery-1.12.4.js" 
        integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU="
        crossorigin="anonymous"></script>
        <script>
            $(function name(params) {
                //1.逐个设置
               $("div").css("width","100px");
               $("div").css("height","100px");
               $("div").css("background","blue");

               //2.链式设置
               //注意点：如果链式操作大于3步，建议分开
               $("div").css("width","100px").css("height","100px").css("background","pink");

               //3.批量设置
               $("div").css({
                    width:"100px",
                    height:"100px",
                    background:"green"
               });

               //4.获取css样式值
               console.log($("div").css("width"));
            });
        </script>
    </head>
    <body>
        <div></div>
    </body>
</html>